package com.zzl.scala

object Lesson05 {
  def main(args: Array[String]): Unit = {
    val p = Person10("angelababy",10)
    p.name="12"
    println(p.name)
    println(p.age)
    println(p.toString)
    println(p.hashCode())
    println(Person10.hashCode())
  }

  def matchPerson(p:Person10) = {
    p match {
      case Person10("dilireba",20)=>println(p.toString)
      case Person10("dilireba",30)=>println(p.toString)
      case o:Person10=>println(o.toString)
      case _=>println("de")
    }
  }
}

case class Person10(var name:String,age:Int)

